package com.tender.controller;


import com.alibaba.nacos.api.model.v2.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.tender.domain.Order;
import com.tender.biz.*;

import javax.annotation.Resource;

@Slf4j
@RestController
public class OrderController {

    @Resource
    private OrderBizService orderBizService;

    /**
     * localhost:2001/order/create?userId=1000&productId=11&count=10&money=100
     */
    @GetMapping("/order/create")
    public Result<Order> create(Order order) {
        orderBizService.create(order);
        return Result.success(order);
    }

    @GetMapping("/hi")
    public Result<Order> hi() {
        Order order = new Order();
        order.setStatus(1);
        order.setId(1L);
        order.setMoney(1000L);
        order.setUserId(11111L);
        return Result.success(order);
    }

}
